/*
============================================================================
FileName	:	XQChatRosterGroup.h
Author		:	liyake
Website		:	http://www.liyake.com
Create Data	:	2012-03-17 16:17
Change Data	:	2012-03-17 16:17 by liyake
Detail		:	The socket client of xqchat application
============================================================================
*/
#ifndef _XQCHAT_ROSTER_GROUP_H_
#define _XQCHAT_ROSTER_GROUP_H_

#include "XQChatRoster.h"
#include <QGraphicsPathItem>
#include "XQChatRosterNode.h"

namespace XQChat
{
	class CXQChatRosterGroup : public QGraphicsPathItem
	{
	public:
		CXQChatRosterGroup(const QString& text,QGraphicsItem * parent = 0);
		~CXQChatRosterGroup(void);

	protected:
		void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
		void hoverEnterEvent( QGraphicsSceneHoverEvent* event );
		void hoverLeaveEvent( QGraphicsSceneHoverEvent* event );

	public:
		void addRosterNodeIfDontExist(CXQChatRoster* pRoster);

	private:
		QString m_qsText;
		QMap<QString, CXQChatRosterNode*> m_mapNodes;
		bool m_bHovered;
	};
}

#endif //_XQCHAT_ROSTER_GROUP_H_